home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
014
/
batcom.arc
/
INP-TEST.BAT
< prev
next >
Wrap
DOS Batch File
|
1985-05-18
|
1KB
|
48 lines
ECHO OFF
.This demonstrates the INPUT program
.Use ECHO statements to create a menu, then branch on the keyin
CLS
ECHO EXAMPLE OF AN INPUT.COM MENU
ECHO ===================================
ECHO To do the first thing, press -- A
ECHO To do the second thing, press -- B
ECHO To do the third thing, press -- 3
ECHO To do the fourth thing, press -- D
ECHO To do the fifth thing, press -- E
ECHO ===================================
.Notice that the input can be any printable key (but forced to upper case)
INPUT "AB3DE"
.Note that the IF ERRORLEVEL checks for error or HIGHER,so you must test
.in reverse order (high first) -- ESC always returns a 255 value
IF ERRORLEVEL 255 GOTO ESC
IF ERRORLEVEL 5 GOTO FIVE
IF ERRORLEVEL 4 GOTO FOUR
IF ERRORLEVEL 3 GOTO THREE
IF ERRORLEVEL 2 GOTO TWO
IF ERRORLEVEL 1 GOTO ONE
:ESC
ECHO You pressed the ESC key
GOTO STOP
:ONE
ECHO You pressed the A key
.User can run a program here
GOTO STOP
:TWO
ECHO You pressed the B key
.User can run a program here
GOTO STOP
:THREE
ECHO You pressed the 3 key
.User can run a program here
GOTO STOP
:FOUR
ECHO You pressed the D key
.User can run a program here
GOTO STOP
:FIVE
ECHO You pressed the E key
.User can run a program here
GOTO STOP
:STOP
.Here, you can start another batch file with a different menu
ECHO ON